let dungeon1 = require('server/config/template/dungeon/dungeon').default;
let event_250001 = require('server/config/template/event/event_250001').default;
let item_200100 = require('server/config/template/item/item_200100').default;
let item_200200 = require('server/config/template/item/item_200200').default;
let item_200300 = require('server/config/template/item/item_200300').default;
let item_200400 = require('server/config/template/item/item_200400').default;
let item_200500 = require('server/config/template/item/item_200500').default;
let item_200600 = require('server/config/template/item/item_200600').default;
let item_200700 = require('server/config/template/item/item_200700').default;
let item_200800 = require('server/config/template/item/item_200800').default;
let item_200900 = require('server/config/template/item/item_200900').default;
let item_201000 = require('server/config/template/item/item_201000').default;
let lattice_270000 = require('server/config/template/lattice/lattice_270000').default;
let map = require('server/config/template/map/map').default;
let monster = require('server/config/template/monster/monster').default;
let npc = require('server/config/template/npc/npc').default;
let player = require('server/config/template/player/player').default;
let resource = require('server/config/template/resource/resource').default;
let skill = require('server/config/template/skill/skill').default;
let task = require('server/config/template/task/task').default;
let building_150000 = require('server/config/template/building/building_150000').default;
let homeBuilding = require('server/config/template/homeBuilding/homeBuilding').default;
let card_190000 = require('server/config/template/card/card_190000').default;
let card_190200 = require('server/config/template/card/card_190200').default;
let maze = require('server/config/template/maze/maze').default;
let base = require('server/config/template/base/base').default;
let toolTable_260000 = require('server/config/template/toolTable/toolTable_260000').default;
let equipment = require('server/config/template/equipment/equipment').default;
let pet = require('server/config/template/pet/pet_310000').default;
let townBuilding = require('server/config/template/townBuilding/townBuilding').default;
let partner = require('server/config/template/partner/partner_330000').default;
let other = require('server/config/template/other/other').default;
let make = require('server/config/template/make/make').default;
let strengthen_430000 = require('server/config/template/strengthen/strengthen_430000').default;
let decompose =  require('server/config/template/decompose/decompose').default;

//所有模板信息
let totalConfig = {};
let totalConfigById = {};
let propName = {}; //发送给客户端的信息 id => name

function getTemplateInfo(templateInfo) {
    let temp = {};
    for (let i in templateInfo) {
        temp[i] = templateInfo[i];
        temp[i]['templateId'] = parseInt(i);
        temp[i]['templateType'] = Math.floor(i / 10000);
        if (templateInfo[i].name) {
            propName[i] = templateInfo[i].name;
        }
        totalConfigById[i] = temp[i];
    }
    return temp;
}

totalConfig.dungeon = Object.assign({}, getTemplateInfo(dungeon1));
totalConfig.event = Object.assign({}, getTemplateInfo(event_250001));
totalConfig.item = Object.assign({}, getTemplateInfo(item_200100), getTemplateInfo(item_200200),
    getTemplateInfo(item_200300), getTemplateInfo(item_200400), getTemplateInfo(item_200500),
    getTemplateInfo(item_200600), getTemplateInfo(item_200700), getTemplateInfo(item_200800), getTemplateInfo(item_200900), getTemplateInfo(item_201000));
totalConfig.lattice = Object.assign({}, getTemplateInfo(lattice_270000));
totalConfig.map = Object.assign({}, getTemplateInfo(map));
totalConfig.monster = Object.assign({}, getTemplateInfo(monster));
totalConfig.npc = Object.assign({}, getTemplateInfo(npc));
totalConfig.player = Object.assign({}, getTemplateInfo(player));
totalConfig.resource = Object.assign({}, getTemplateInfo(resource));
totalConfig.skill = Object.assign({}, getTemplateInfo(skill));
totalConfig.task = Object.assign({}, getTemplateInfo(task));
totalConfig.building = Object.assign({}, getTemplateInfo(building_150000));
totalConfig.homeBuilding = Object.assign({}, getTemplateInfo(homeBuilding));
totalConfig.maze = Object.assign({}, getTemplateInfo(maze));
totalConfig.card = Object.assign({}, getTemplateInfo(card_190000), getTemplateInfo(card_190200));
totalConfig.toolTable = Object.assign({}, getTemplateInfo(toolTable_260000));
totalConfig.equipment = Object.assign({}, getTemplateInfo(equipment));
totalConfig.pet = Object.assign({}, getTemplateInfo(pet));
totalConfig.townBuilding = Object.assign({}, getTemplateInfo(townBuilding));
totalConfig.partner = Object.assign({}, getTemplateInfo(partner));
totalConfig.other = Object.assign({}, getTemplateInfo(other));
totalConfig.make = Object.assign({}, getTemplateInfo(make));
totalConfig.strengthen = Object.assign({}, getTemplateInfo(strengthen_430000));
totalConfig.decompose = Object.assign({}, getTemplateInfo(decompose));
totalConfig.base = base;

export {
    totalConfig,
    totalConfigById,
    propName
}